﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SchSchoolInfo.aspx.cs" Inherits="Base_School_SchSchoolInfo" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>学校信息</title>
    <link href="../Common/css/main.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        #load{width:500px;height:25px;border:1px #000 solid;}
        #loading{position:absolute;z-index:2;height:23;filter:progid:DXImageTransform.microsoft.gradient(gradienttype=1,startColorStr=white,endColorStr=#39867b);}
        #loadtext{position:absolute;z-index:3;width:100%;height:100%;line-height:23px;text-align:center;}
    </style>

    <script type="text/javascript" src="../Common/Js/jquery.js"></script>

    <script type="text/javascript" src="../Common/Js/common.js"></script>
    <script type="text/javascript" src="../Common/Js/jsUtil.js"></script>

    <script type="text/javascript">
        function modifySchoolName(obj) {
            var aName = obj.innerHTML;
            var spanSchoolName = document.getElementById("spanSchoolName");
            var txtSchoolName = document.getElementById("txtSchoolName");
            if (aName == "修改") {
                obj.innerHTML = "保存";
                
                spanSchoolName.style.display = "none";
                txtSchoolName.style.display = "inline";
            }
            if (aName == "保存") {
                obj.innerHTML = "修改";
                if (!checkForm()) return;
                PageMethods.UpdateSchoolName(txtSchoolName.value.trim(),
                    function(succ) {
                        spanSchoolName.innerHTML = txtSchoolName.value.trim();
                        parent.setSchoolName(txtSchoolName.value.trim());
                        spanSchoolName.style.display = "inline";
                        txtSchoolName.style.display = "none";
                    }
                );
            }
        }
        
        function checkForm() {
            var txtSchoolName = document.getElementById("txtSchoolName");
            if (txtSchoolName.value.trim() == "") {
                showNoticMsg("txtSchoolName", "请填写学校名");
                return false;
            }
            return true;
        }
        
        function cancelSchoolName(obj) {
            var spanSchoolName = document.getElementById("spanSchoolName");
            var txtSchoolName = document.getElementById("txtSchoolName");
            
            obj.style.display = "none";
            txtSchoolName.style.display = "none";
            spanSchoolName.style.display = "inline";
        }
    </script>

</head>
<body>
    <div class="mainWarp">
        <div class="pageBody" style="text-align: center">
            <form id="form1" runat="server">
                <table style="margin-top: 15%; border: #c3dce5 solid;">
                    <tr>
                        <td>
                            <table style="width: 360px; height: 180px; text-align: center;" border="0" class="layoutTable">
                                <tr>
                                    <td style="text-align: left; padding-left: 20%;">
                                        学 校 名：&nbsp; <span id="spanSchoolName">
                                            <%= CommonScore.SchoolName %>
                                        </span>
                                        <input id="txtSchoolName" type="text" style="display: none; width: 80px;" class="textInput" onfocus=""
                                            maxlength="20" value='<%= CommonScore.SchoolName %>' />
                                        <a id="aModifySchoolName" href="javascript:void(0)" onclick="modifySchoolName(this)">
                                            修改</a>
                                        <a id="aCancelSchoolName" href="javascript:void(0)" onclick="cancelSchoolName(this)" style="display: none;">
                                            取消</a>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="text-align: left; padding-left: 20%;">
                                        学&nbsp;&nbsp;&nbsp;&nbsp;年：&nbsp;
                                        <%= Common.GloblTermInfo==null?"":Common.GloblTermInfo.GlobalYear+"学年" %>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="text-align: left; padding-left: 20%;">
                                        学&nbsp;&nbsp;&nbsp;&nbsp;期：&nbsp;
                                        <%= Common.GloblTermInfo == null ? "" : (Common.GloblTermInfo.GlobalTerm == 2 ? "下学期" : "上学期")%>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="text-align: left; padding-left: 20%;">
                                        学校性质：&nbsp;
                                        <%= Common.SchoolOpt %>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
                <div>
                    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
                    </asp:ScriptManager>
                </div>
            </form>
        </div>
    </div>
</body>
</html>
